package com.dao;

import com.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created with LXD
 *
 * @author:Luhui
 * @qq:729913162
 * @Date:2018-07-22
 * @Time:20:10
 */
public interface UserDao {
    @Insert("insert into user (id,username,password)values(null,#{username},#{password})")
    int addUser(User user);

    @Select("select * from user where username =#{username} and password = #{password}")
    User findOne(User user);

    @Select("select * from user where id=#{id}")
    User findUserById(int id);

    @Update("update user set age=#{age},name=#{name},sex=#{sex},school=#{school} where id=#{id}")
    int updUser(User user);
}
